1. Field of the Invention
The present invention relates to bit field manipulation, and in particular to techniques for bit field extraction and bit field insertion.
2. Description of the Prior Art
Bit field manipulation techniques are known. These techniques are typically employed by a data processing apparatus when seeking to manipulate predetermined bits of a data value. Typical examples of bit field manipulation techniques include bit field insertion operations and bit field extraction operations.
In a bit field extraction operation, a data value is provided and the data processing apparatus is arranged, in response to a bit field extract instruction, to extract a predetermined sequence of bits from that data value. The extracted data bits can then be used thereafter in subsequent data processing operations. For example, a typical bit field extraction instruction may cause bit 3 to bit 10 (i.e. 8 sequential bits) to be extracted from a 32 bit data value and make the extracted data bits to be available for subsequent data processing operations.
In a typical bit field insertion operation, a predetermined sequence of bits from one data value is inserted into another data value. For example, a typical bit field insertion instruction may cause an 8 bit data value to be inserted into a 32 bit data value starting at bit 3 of the 32 bit data value and make the resultant data value available for subsequent data processing operations.
It will be appreciated that these two operations enable a wide range of useful data manipulation operations to be performed on data values.
In order to support these bit field manipulation operations, the data processing apparatus typically is provided with dedicated hardware arranged to perform such operations. When a bit field manipulation operation is required, the data processing apparatus will pass the data values to be manipulated to that dedicated hardware in order to perform the particular operation required. Typically, the bit field manipulated data value will then be returned to the data processing apparatus for subsequent operations.
It is desired to provide an improved technique for performing such bit field manipulation operations.